<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
      
<ui:composition template="/restrito/template.xhtml">

<ui:define name="menu"><ui:include src="menu.xhtml"/></ui:define>

<ui:define name="corpo">
<div class="container">
	<ui:include src="../mensagem.xhtml"/>
	<h:form id="f" styleClass="form-search">
		<a4j:outputPanel id="pnResultadoMensagem">
		   	<c:if test="#{pesquisarProfissionalMB.lsUsuarioProfissional != null and empty pesquisarProfissionalMB.lsUsuarioProfissional}">
		   		<div class="alert"><a class="close" data-dismiss="alert">×</a>Nenhum profissional encontrado com os filtros informados.</div>
		   	</c:if>
		</a4j:outputPanel>
		<div class="well">
	        <h:inputText styleClass="input-medium search-query" />
	        <a4j:commandButton value="Pesquisar" action="#{pesquisarProfissionalMB.pesquisar}" styleClass="btn" render="pnResultado pnResultadoMensagem"/>
        </div>
        <a4j:outputPanel id="pnResultado">
        	<c:if test="#{not empty pesquisarProfissionalMB.lsUsuarioProfissional}">
			<table class="table table-striped table-bordered tabela">
			<thead>
				<tr>
					<th>Nome</th>
					<th>CRM</th>
					<th>E-mail</th>
				</tr>
			</thead>
			<tbody>
			<ui:repeat var="p" value="#{pesquisarProfissionalMB.lsUsuarioProfissional}" varStatus="i">
				<tr>
					<td>#{p.nome}</td>
					<td>#{p.crmEstado}#{p.crmNumero}</td>
					<td>#{p.email}</td>
			   	</tr>
		   	</ui:repeat>
		   	</tbody>
			</table>
			</c:if>
		</a4j:outputPanel>
	</h:form>
</div>
</ui:define>
</ui:composition>
</html>
